//بسم الله الرحمن الرحيم
// i love mancity
#include<bits/stdc++.h>
#include <stack>
#include <vector>
#define endl "\n"
#define ll long long
#define f(a) for(int i=0;i<a;i++)
#define rf(a) for(int i=a-1;i>=0;i--)
#define w int t;cin>>t;while(t--)
#define all(v) v.begin(),v.end()
#define yes cout<<"YES"<<endl;
#define no cout<<"NO"<<endl;
#define prev2pn(x) pow(2,floor(log2(x)))
#define MR_Robot iostream::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
#define MA INTMAX
#define Mn INTMIN
using namespace std;
const ll MOD=1e9+7;
const int N=1000;
bool test[N];
//int e,n,Minx=INT_MAX,Maxx=INT_MIN,Miny=INT_MAX,Maxy=INT_MIN;
const int mxx=1000005;
//ll a[mx];
//vector<vector<ll>>v;
ll power(ll x, ll y,ll mod)
{
ll temp;
if( y == 0)
return 1;
temp = power(x, y / 2,mod)%mod;
if (y % 2 == 0)
return (temp * temp)%mod;
else
return ((x * temp )%mod* temp)%mod;
}
set<ll>sv;
void sieve(ll x){
bool primes[x+5];
memset(primes,false,sizeof primes);
for (ll i = 2; i*i <=x ; ++i) {
if(!primes[i]){
for (ll j = i*i; j <=x ; j+=i) {
primes[j]= true;
}
}
}
for (ll i = 2; i <=x ; ++i) {
if(!primes[i]){
sv.insert(i*i);
}
}
}
set<long long> lucky_numbers;
void generate_lucky_number() {
for (int i = 0; i <= 10; i++) {
for (int j = 0; j < (1 << i); ++j) {
string s;
int cnt1 = 0, cnt2 = 0;
for (int k = 0; k < i; ++k) {
if ((1 << k) & j) {
s += "7";
cnt1++;
} else {
s += "4";
cnt2++;
}
}
if (!s.empty())lucky_numbers.insert(stoll(s));
}
}
}
ll solve2(ll a) {
ll cnt=0;
for (ll i = 2; i*i <= a ; ++i) {
if(a%i==0){
if(i*i==a){
cnt++;
}else{
cnt+=2;
}
}
}
return cnt;
}
vector<int>adj[N];
bool vis[N];
bool ff[N];
vector<int>top;
int color[N];
ll n,m,cnt=1,mx=INT_MIN;
bool f=false;
bool invalid(int x,int y){
if(x<0||x>=n||y<0||y>=m)return false;
else return true;
}
void dfs(int node){
vis[node]= true;
for (auto u:adj[node]) {
if (!vis[u]) {
cnt*=2;
dfs(u);
}
}
}
void solve(){
cin>>n>>m;
for (int i = 0; i < m; ++i) {
int x, y;
cin >> x >> y;
x--; y--;
adj[x].push_back(y);
adj[y].push_back(x);
}
for (int i = 0; i < n; ++i) {
if (!vis[i]) {
dfs(i);
}
}
cout<<cnt<<endl;
}
int main() {
MR_Robot
#ifndef ONLINE_JUDGE
freopen("in.txt", "r", stdin);
freopen("out.txt", "w", stdout);
#endif
int z=1;
// w {
solve();
// }
return 0;
}
1665B - Array Cloning Technique | 1665A - GCD vs LCM |
118D - Caesar's Legions | 1598A - Computer Game |
1605A - AM Deviation | 1461A - String Generation |
1585B - Array Eversion | 1661C - Water the Trees |
1459A - Red-Blue Shuffle | 1661B - Getting Zero |
1661A - Array Balancing | 1649B - Game of Ball Passing |
572A - Arrays | 1455A - Strange Functions |
1566B - MIN-MEX Cut | 678C - Joty and Chocolate |
1352E - Special Elements | 1520E - Arranging The Sheep |
1157E - Minimum Array | 1661D - Progressions Covering |
262A - Roma and Lucky Numbers | 1634B - Fortune Telling |
1358A - Park Lighting | 253C - Text Editor |
365B - The Fibonacci Segment | 75A - Life Without Zeros |
1519A - Red and Blue Beans | 466A - Cheap Travel |
659E - New Reform | 1385B - Restore the Permutation by Merger |